/**
 * 
 */
package com.earltech.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.earltech.bean.TbResume;
import com.earltech.service.ResumeService;
import com.earltech.service.SystemService;

/**
 * @author jiangjintai
 *
 */
@Controller
public class RecruitController {
	
	@Autowired
	SystemService systemService;
	@Autowired
	ResumeService resumeService;
	
	@RequestMapping("/index")
	public String index(){
		return "/index";
	}
	
	@RequestMapping("/contact")
	public String contact(){
		systemService.saveAndAdd1();
		return "/contact";
	}
	
	@RequestMapping("/doResume")
	public String doResume(HttpServletRequest request,TbResume tbResume,Model model){
		resumeService.save(tbResume);
		model.addAttribute("message", "报名成功，感谢对伯爵的支持");
		model.addAttribute("url", request.getContextPath()+"/index");
		return "/message";
	}
	
}
